const fs = require('fs');

// const promise = require('promise');      promise 不用引入模板

let promise = new Promise((resolve, reject) => {
    fs.readFile('./1.txt', 'utf8', (err, result1) => {
        if (err != null) {
            reject(err);
        } else {
            resolve(result1);
        };
    });
});

promise.then((result) => {
    console.log(result);
})
.catch((error) => {
    console.log(error);
});